namespace UniversalAdminSystem.Domian.Core.Interfaces;

/// <summary>
/// 通用仓储接口,提供通用的数据访问方法（CRUD）
/// </summary>
public interface IRepository<T> where T : class
{
    /// <summary>
    /// 新增
    /// </summary>
    /// <param name="entity"></param>
    /// <returns></returns>
    Task<T> AddAsync(T entity);

    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="guid"></param>
    /// <returns></returns>
    Task RemoveAsync(Guid guid);

    /// <summary>
    /// 更新
    /// </summary>
    /// <param name="entity"></param>
    /// <returns></returns>
    Task Update(T entity);

    /// <summary>
    /// 查询所有
    /// </summary>
    /// <returns></returns>
    Task<IEnumerable<T>> GetAllAsync();

    /// <summary>
    /// 查询指定
    /// </summary>
    /// <returns></returns>
    Task<T?> GetByGuidAsync(Guid guid);
}